package com.leo.erp.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.ibatis.annotations.Param;
import com.leo.erp.dto.SupplierExecution;
import com.leo.erp.entity.Supplier;
import com.leo.erp.util.GlobalRuntimeException;

public interface SupplierService {
	
	/**
	 * 导入插入
	 * @param mList
	 * @return
	 */
	SupplierExecution importExcel(List<Supplier> mList);
	
	/**
	 * 查询信息列表
	 * @param supplier
	 * @param type
	 * @param phonenum
	 * @param telephone
	 * @param description
	 * @return
	 */
	List<Supplier> findByAll(String supplier, String type, String phoneNum, String telephone, String description);
	
	/**
	 * 批量启动
	 * @param enabled
	 * @param supplierIDs
	 * @return
	 */
	SupplierExecution batchSetEnable(int enabled, String supplierIDs);
	
	/**
	 * 强制删除
	 * @param ids
	 * @return
	 */
	int batchDeleteSupplierByIds(String ids);
	
	/**
	 * 正常删除，要考虑数据完整性，进行完整性校验
	 * @param ids
	 * @return
	 */
	SupplierExecution batchDeleteSupplierByIdsNormal(String ids);
	
	/**
	 * 查询列表信息
	 * @param supplier
	 * @param type
	 * @param phoneNum
	 * @param telephone
	 * @param description
	 * @param currentPage
	 * @param pageSize
	 * @return
	 */
	SupplierExecution getList(String supplier, String type, String phoneNum, String telephone, String description, int currentPage, int pageSize);
	
	/**
	 * 更新供应商和客户信息表
	 * @param beanJson
	 * @param id
	 * @param request
	 * @return
	 */
	SupplierExecution updateSupplier(String beanJson, int supplierId, HttpServletRequest request);
	
	/**
	 * 查询会员信息
	 * @return
	 */
	SupplierExecution findBySelectRetail();
	
	/**
	 * 查询客户信息
	 * @return
	 */
	SupplierExecution findBySelectCus();
	
	/**
	 * 查询供应商信息
	 * @return
	 */
	SupplierExecution findBySelectSup();
	
	/**
	 * 添加
	 * @param beanJson
	 * @param request
	 * @return
	 */
	SupplierExecution insertSupplier(String beanJson, HttpServletRequest request) throws GlobalRuntimeException;
	
	/**
	 * 查询名称是否存在
	 * @param id
	 * @param name
	 * @return
	 */
	SupplierExecution checkIsNameExist(int id, String name);
	
	/**
	 * 查询用户对应客户的信息
	 * @return
	 */
	SupplierExecution findUserCustomer();
}
